package com.mall.ibatis.persistence.iface;

import java.util.List;

import com.mall.ibatis.bean.Frame;
import com.mall.ibatis.bean.FunctionMethod;
import com.mall.ibatis.bean.Operator;
import com.mall.ibatis.bean.ReturnMessage;


public interface OperatorDAO
{
	public List<Operator> selectAllOperator() throws Exception;
	public List<Operator> selectAllOperator(Operator operator) throws Exception;
	public Integer selectAllOperatorCount(Operator operator) throws Exception;
	public Operator selectOperator(Operator operator)  throws Exception;
	public String insertOperator(Operator operator) throws Exception;
	public void updateOperator(Operator operator) throws Exception;
	public void deleteOperator(Operator operator) throws Exception;
	
	public ReturnMessage validOperator(String username,String loginIP,String password) throws Exception;
	public ReturnMessage modifyPassword(String operatorID,String oldPassword,String newPassword,String confirmPassword) throws Exception;
	public void updateOperatorWithoutPassword(Operator operator) throws Exception;
	public void updateOperatorPassword(Operator operator)	throws Exception;
	
	public void getOperatorRoles(String operatorID,String roleIDs,String roleNames)throws Exception;
	
	//ryh
	//保存用户和数据范围之前先删除先前的对应关系来完成更新操作
	public void deleteDataScopeByOpId(String opId) throws Exception;
	//保存用户和数据范围的对应关系
	public void addDataScope(String opId, String str);
	//添加方法和功能的对应关系
	public String addMethodFunction(FunctionMethod fm);
	//添加方法和功能对应关系前先按照角色的id来删除，方便实现覆盖操作
	public int deleteMethodFunction(String id) throws Exception;
	//向服务器请求勾选了哪些方法并返回给修改树状窗口
	public List<FunctionMethod> methodIsCheck(String id);
	//通过用户的Id查询出相应的数据范围名称以及Id
	public List<String> selectDataScope(String opId);
	//管理架构功能树一次性加载
	public List<Frame> frame();
	//向服务器请求勾选了哪些功能方法并返回给修改树状窗口
	public List<String> functionIsCheck(String id);
	//先删除已经有的功能
	public void deleteOperatorFunction(String id) throws Exception;
	//批量插入功能集合
	public void addOperatorFunction(String id, String functionId);
	
	/**
	 * 得到街道收费人员列表
	 * @param street 街道编号
	 * @return 收费人员列表
	 * */
	public List<Operator> selectStreetCharger(String street) throws Exception;
	
}